package com.woniuxy.cloud.api;

import com.woniuxy.cloud.demo.Result;
import com.woniuxy.cloud.dto.BatteryDto;
import com.woniuxy.cloud.param.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author 高瑞
 * @date 2022/2/10 001010:10
 */
@FeignClient(value = "battery")
public interface BatteryQueryApi {

    @GetMapping("/getById/{id}")
    Result getById(@PathVariable("id") Integer id);

    @PostMapping("/queryBattery")
    Result queryBattery(@RequestBody ListBatteryParam listBatteryParam);

    @PostMapping("/batteriesIsHealth")
    List<BatteryDto> batteriesIsHealth(@Validated @RequestBody BatteriesIsHealthParam param);

    @PostMapping("/findBatteryByIds")
    Result<List<BatteryDto>> findBatteryByIds(@RequestBody List<Integer> ids);

    @PostMapping("/addBattery")
    Result addBattery(@RequestBody BatteryParam batteryParam);

    @PostMapping("/delBattery")
    Result delBattery(@RequestBody List<Integer> batteryIds);

    @PostMapping("/updateBattery")
    Result updateBattery(@RequestBody BatteryParam batteryParam);

    @PostMapping("/updateBatteryById")
    Boolean updateBatteryById(@RequestBody UpdateParam updateParam);

    @PutMapping("/updateList")
    Result<Boolean> updateList(@RequestBody UpdateListParam updateListParam);

    @PostMapping("/addBatteryList")
    Result addBatteryList(@RequestBody AddListBatteryParam addListBatteryParam);

}
